#include <algorithm>
#include <iostream>
#include <vector>
#define LL long long
using namespace std;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (cin >> T; T; T--) {
    LL n;
    LL tmp = 10;
    vector<LL> ans;

    cin >> n;
    for (int i = 0; i < 18; i++) {
      if (n % (tmp + 1) == 0) {
        ans.emplace_back(n / (tmp + 1));
      }
      tmp = tmp * 10;
    }
    cout << ans.size() << "\n";
    reverse(ans.begin(), ans.end());
    for (LL x : ans) {
      cout << x << " ";
    }
    if (ans.size()) {
      cout << "\n";
    }
  }
  return 0;
}